package com.ssy.lingxi.member.merchant.controller.web;

import com.ssy.lingxi.common.response.Wrapper;
import com.ssy.lingxi.member.merchant.model.vo.basic.response.ChannelListVO;
import com.ssy.lingxi.member.merchant.service.feign.IMemberAbilitySalesFeignService;
import com.ssy.lingxi.member.merchant.service.web.IMemberAbilitySalesService;
import org.springframework.http.HttpHeaders;
import org.springframework.web.bind.annotation.RequestHeader;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestMethod;
import org.springframework.web.bind.annotation.RestController;

import javax.annotation.Resource;
import java.util.List;

/**
 * @menu 业务员搜索下拉列表接口
 * @author 郑小翠
 * @version 2.02.18
 * @date 2022-04-07
 */
@RestController
@RequestMapping("/member/ability/sales/search")
public class MemberSalesController {

    @Resource
    private IMemberAbilitySalesFeignService memberAbilitySalesService;

    @Resource
    private IMemberAbilitySalesService memberSalesService;

    /**
     * 订单能力-业绩统计-业务员业绩统计-所属机构
     *
     * @param headers 头部信息
     * @return 返回机构信息
     */
    @RequestMapping(value = "/organizationList", method = RequestMethod.GET)
    public Wrapper<List<String>> getMemberOrganizationList(@RequestHeader HttpHeaders headers) {
        return memberSalesService.getMemberOrganizationList(headers);
    }

    /**
     * 订单能力-业绩统计-订单明细-业务员列表
     *
     * @param headers 头部信息
     * @return 返回业务员列表
     */
    @RequestMapping(value = "/channel/list", method = RequestMethod.GET)
    public Wrapper<List<ChannelListVO>> getChannelList(@RequestHeader HttpHeaders headers) {
        return memberAbilitySalesService.getChannelList(headers);
    }
}
